package com.datastructure.test.nimgame;

import java.util.ArrayList;

public class NimGame {

    public static void main(String[] args) {

    }
    ArrayList<Integer> list = new ArrayList<>();
    public boolean NimGame (int n) {
        // write code here
        computeTime(n,1);
        for (Integer integer : list) {
            if(integer%2==1){
                return true;
            }
        }
        return false;
    }

    private void computeTime(int n, int size) {
        if(n<=3){
            list.add(size);
            return;
        }
        computeTime(n-1,size+1);
        computeTime(n-2,size+1);
        computeTime(n-3,size+1);
    }
}
